<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="font-awesome-4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/selectize.css">
    <link rel="stylesheet" href="css/selectize.bootstrap3.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" type="text/css" href="css/wangEditor.min.css">
    <link rel="stylesheet" href="css/toastr.css">
    <style type="text/css">
    .content .main{margin-left:12%;width:80%;}
    th{text-align:right;}
    .pmtable td{padding-left:3px;padding-right:20px;padding-top:20px;}
    .pmtable td{font-size:14px;width:420px;line-height:160%;}
    tr{height:150px;}
    .kao{text-align:right;width:100px;}
    .kao span{color:red;}
    </style>
</head>
<body>
<?php 
$nav='kao';
include_once './view/_top.php';
$tiData=array();

if (isset($_GET['id']) && isset($_GET['tb'])){
	$id=$_GET['id'];
	$sql="select * from ".$_GET['tb']." where id=".$id." limit 0,1 ";
	$query = $this->mysqli->query($sql);
	$userTi=$query->fetch_array();
	$nianji=$userTi['nianji'];
	if ($nianji == '五年级'){
		$nj=5;
	}elseif ($nianji == '四年级'){
		$nj=4;
	}elseif ($nianji == '六年级'){
		$nj=6;
	}else{
		$nj=3;
	}
	
	$citable=$_GET['tb'];
	if ('ci3' == $citable){
		$nj=3;
	}elseif ('ci4' == $citable){
		$nj=4;
	}elseif ('ci5' == $citable){
		$nj=5;
	}else{
		$nj=6; 
	}
	
	
	
}else{
	exit;
}
$sql="select id,tid,title,da,db,dc,dd,dan,step from ti where nianji=".$nj." ";
$query = $this->mysqli->query($sql);
while ($list=$query->fetch_array()){
	$tiData[$list['id']]=$list;
}
?>
<div class="container-fluid content" id="content">
    <!-- ngView:  --><div ng-view="" class="ng-scope"><div class="container-fluid content ng-scope" id="content">
    <div class="sidebar">
        <ul class="nav nav-sidebar">
            <li id="b" class="active"><a href="?c=student&a=kao">考试信息</a></li>
        </ul>
    </div>

    <div class=" main" style="min-width: 600px">
        <div class="main-cont">
            <div class="sub-header" style="margin-bottom: 10px;padding: 0px">
                <h4 style="margin-bottom: 0px;padding-bottom: 20px">答题信息</h4></div>
 
            <table class="pmtable" style="min-width: 600px">
                <tbody> 
                <?php 
                $tiku=json_decode($userTi['tiku']);
                $dati=json_decode($userTi['dati']);
                foreach ($tiku as $k=>$v){ ?>
                <tr>
                    <td><?php echo $tiData[$v]['tid'],'.',$tiData[$v]['title'] ?></td>
                    <td class="ti">
                        A:<?php echo $tiData[$v]['da'] ?><br />
                    	B:<?php echo $tiData[$v]['db'] ?><br />
                    	C:<?php echo $tiData[$v]['dc'] ?><br />
                    	D:<?php echo $tiData[$v]['dd'] ?><br />
                    	[答案:<?php echo $tiData[$v]['dan'] ?>]
                    </td>
                    <td class="kao"><?php if (isset($dati[$k]) && $tiData[$v]['dan'] == $dati[$k]){ ?><span>对</span><?php } ?> &nbsp;考生答:<?php if (isset($dati[$k])){echo $dati[$k];} ?></td>
                </tr>
                <?php } ?>
                
                
            </tbody></table>
            <div class="hr-line-dashed"></div>
            
        </div>
    </div>
    </div>


<div class="modal fade ng-scope" id="mymodal2">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">提示</h4>
            </div>
            <div class="modal-body">
                <p>是否删除该职位</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button data-toggle="modal" data-target="#mymodal3" type="button" class="btn btn-success" data-dismiss="modal">确定</button>
            </div>
        </div>

    </div>
</div>


</div>
</div>
 
<script src="js/jquery-2.2.4.min.js"></script>
<script src="js/toastr.js"></script>
<script src="js/easing.js"></script>
<script src="js/selectize.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/wangEditor.js"></script>
<script src="js/TileHeadPic.js"></script>
<script src="js/calendar.js"></script>
<script type="text/javascript">
$(function () {

    $('#remind').click(function () {
        toastr.options = {
            closeButton: false,
            debug: false,
            progressBar: false,
            positionClass: "toast-center",
            onclick: null,
            showDuration: "200",
            hideDuration: "1000",
            timeOut: "3000",
            extendedTimeOut: "1000",
            showEasing: "swing",
            hideEasing: "linear",
            showMethod: "fadeIn",
            hideMethod: "fadeOut"
        };
        var title=$("#title").val();
        var nianji=$("#nianji").val();
        var step=$("#step").val();
        var da=$("#da").val();
        var db=$("#db").val();
        var dc=$("#dc").val();
        var dd=$("#dd").val();
        var de=$("#de").val();
        var df=$("#df").val();
        var dan=$("#dan").val();

        if('' == title){
            var $toast = toastr['info']('请输入题目', '提示');
            return;
        }
        if('' == da){
            var $toast = toastr['info']('请输入选项A', '提示');
            return;
        }

        
        var $toast = toastr['info']('保存成功', '提示');
         
        $.post("?c=login&a=add", {title:title,nianji:nianji,step:step,
        	da:da, db:db,dc:dc,dd:dd,de:de,df:df,dan:dan}, function(data){
        	window.setTimeout(function(){
            	window.location.href="?a=home"; 
                }, 1000);
		 }, "json");
        
        
        
    });

})


function Aoo(obj) {
    $("mymodal2").modal("toggle");


}
$(function(){
    $('[data-toggle="tooltip"]').tooltip()
})
</script>
</body></html>